//
//  CustomToggleStyle.swift
//  Kosspot
//
//  Created by 胡辉 on 2025/6/27.
//
import SwiftUI

struct CustomToggleStyle: ToggleStyle {
    func makeBody(configuration: Configuration) -> some View {
        HStack(alignment: .center, content: {
            configuration.label
                .foregroundColor(configuration.isOn ? .primary : .secondary)
                .font(.system(size: 16, weight: .medium))
            
            Spacer().frame(width: 0)
            Button(action: {
                withAnimation {
                    configuration.isOn.toggle()
                }
            }) {
                Image(systemName: configuration.isOn ? "checkmark.circle.fill" : "circle.fill")
                    .foregroundColor(configuration.isOn ? Color(hex: "#00E9DA") : .white)
                    .font(.system(size: 16, weight: .light))
            }
        })
    }
}
